<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set content disposition</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.setcachecontrol.html">HttpResponse::setCacheControl</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setcontenttype.html">HttpResponse::setContentType</a></div>
 <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="httpresponse.setcontentdisposition" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">HttpResponse::setContentDisposition</h1>
  <p class="verinfo">(PECL pecl_http &gt;= 0.10.0)</p><p class="refpurpose"><span class="refname">HttpResponse::setContentDisposition</span> &mdash; <span class="dc-title">Set content disposition</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-httpresponse.setcontentdisposition-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">static</span>
   <span class="type">bool</span> <span class="methodname"><strong>HttpResponse::setContentDisposition</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$filename</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$inline</code><span class="initializer"> = false</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Set the <em>Content-Disposition</em>.
   当实际被发送的来自文件或类似东西的数据，要被客户端／用户（例如，浏览器的“另存为...”弹出窗口）“保存”时，<em>Content-Disposition</em>
头是十分有用的。
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-httpresponse.setcontentdisposition-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">filename</code></em></dt>

     <dd>

      <p class="para">
       the file name the &quot;Save as...&quot; dialog should display
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">inline</code></em></dt>

     <dd>

      <p class="para">
       if set to true and the user agent knows how to handle the content type,
       it will probably not cause the popup window to be shown
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-httpresponse.setcontentdisposition-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 


 


 


 <div class="refsect1 seealso" id="refsect1-httpresponse.setcontentdisposition-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="httpresponse.getcontentdisposition.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::getContentDisposition()</a> - Get content disposition</span></li>
    <li class="member"><span class="methodname"><a href="httpresponse.getcontenttype.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::getContentType()</a> - Get content type</span></li>
    <li class="member"><span class="methodname"><a href="httpresponse.setcontenttype.html" class="methodname" rel="rdfs-seeAlso">HttpResponse::setContentType()</a> - Set content type</span></li>
   </ul>
  </p>
 </div>



</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httpresponse.setcachecontrol.html">HttpResponse::setCacheControl</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httpresponse.setcontenttype.html">HttpResponse::setContentType</a></div>
 <div class="up"><a href="class.httpresponse.html">HttpResponse</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
